package com.tech.tool.repository;

import com.tech.tool.dataobject.ProjectInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface ProjectInfoRepository extends JpaRepository<ProjectInfo, Integer> {

    @Query(value = "select * from project_info where project_delete=?1 and if(?2 !=0, bu_id = ?2, 1=1)" ,nativeQuery = true)
    Page<ProjectInfo> findByProjectDeleteAndBuId(Integer delete, Integer buId, Pageable pageable);
}
